﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IceDog.DNC.Web.Swashbuckle1_X.CustomAttribute
{
    /// <summary>
    /// 只在规定的版本中显示
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class ApiVersionAttribute : Attribute
    {
        private string[] _versions;

        /// <summary>
        /// ApiVersion控制，不传值，默认为v1
        /// </summary>
        public ApiVersionAttribute()
        {

        }

        /// <summary>
        /// 
        /// </summary>
        public string[] Versions
        {
            get => _versions ?? new []{"1"};
            set=> _versions = value;
        }
    }
}
